﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;

namespace AnyOffice.general.calendar.manage
{
    public partial class note : ModulePage
    {
    
        protected void Page_Load(object sender, EventArgs e)
        {
            int calId = (Request.QueryString["cal_id"] != null) ? int.Parse(Request.QueryString["cal_id"].ToString()) : 0;
            DataTable table = new CalendarDao().SelectByCalId(base.Conn, calId, base.User.Identity.Name);
            if (table.Rows.Count > 0)
            {
                this.litStartTime.Text = Convert.ToDateTime(table.Rows[0]["StartTime"].ToString()).ToString("g");
                this.litContent.Text = table.Rows[0]["Content"].ToString().Replace("\n", "<br>");
                this.litManagerUserName.Text = (table.Rows[0]["ManagerUserName"] != DBNull.Value) ? ("（安排人：" + table.Rows[0]["ManagerUserName"].ToString() + "）") : "";
                this.ViewState["Content"] = table.Rows[0]["Content"].ToString();
            }
            else
            {
                this.litContent.Text = "没有相关日程安排！";
            }
        } 

    }
}
